<html>
<head>
</head>
<script type="text/javascript" src="<?php echo base_url();?>js/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="<?php echo base_url();?>js/init_tinymce.js"></script>
<script language="javascript">
function buka()
{
	w_left = (screen.width-700)/2;
	w_top  = (screen.height-420)/2;

	window.moveTo(w_left,w_top);
}

</script>
<script type="text/javascript">
function add_file_field(){
var container=document.getElementById('file_container');
var file_field=document.createElement('input');
file_field.name='images[]';
file_field.type='file';
container.appendChild(file_field);
var br_field=document.createElement('br');
container.appendChild(br_field);
}

</script>

<style>
body
{
	padding:2%;
}
</style>
<body onLoad="buka()">
<h2>CREATE COMENTS</h2>
<form action="<?php echo site_url('createticket/ticket/ticket_1');?>" method="post" enctype="multipart/form-data">
<table>
	<tr>
    	<td>Coments ID</td><td></td><td>
        <?php foreach($idcomnt->result() as $idcmnt) { ?>
        <input type="text" name="comment_id"  value="<?php echo $idcmnt->comment_id + 1;?>" disabled />
        <input type="hidden" name="comment_id"  value="<?php echo $idcmnt->comment_id + 1;?>" />
        <?php } ?>
        </td><td><?php echo form_error('comment_id', '<i class="field_error">', '</i>');?></td>
    </tr>
    <tr>
    	<td>Ticket ID</td><td></td><td>
        <?php foreach($id_ticket->result() as $idtc) { ?>
        <input type="text" name="ticked_id" value="<?php echo $idtc->ticket_id + 1;?>" disabled/>
        <input type="hidden" name="ticked_id" value="<?php echo $idtc->ticket_id + 1;?>"  />
        <?php } ?>
        </td><td><?php echo form_error('ticked_id', '<i class="field_error">', '</i>');?></td>
        
    </tr>
    <tr>
    	<td>Comments</td><td></td><td></td><td></td>
    </tr>
    <tr>
    	<td></td><td></td><td><textarea name="comments" readonly="readonly"  rows="20"></textarea>
        </td><td><?php echo form_error('comments', '<i class="field_error">', '</i>');?></td>
    </tr>
    <tr>
    	<td>Datetime</td><td></td><td><input type="text" name="datetime" readonly="" value="<?php echo date("d/m/Y H:i");?>"/></td><td></td>
    </tr>
    <tr>
    	<td></td><td></td><td><div id="file_container">
    <input name="images[]" type="file"  /><br />
    
  </div><a href="javascript:void(0);" onClick="add_file_field();">Add another</a></td><td></td>
    </tr>
    <tr>
    	<td></td><td></td><td>&nbsp;</td><td></td>
    </tr>
    <tr>
    	<td></td><td></td><td><input type="submit" name="save" value="Save"/>&nbsp;&nbsp;<input type="reset" value="Reset" />&nbsp;&nbsp;<input type="button" value="Close" onClick="window.close()" /></td><td></td>
    </tr>
</table>
</form>
</body>
</html>